<%--
  Created by IntelliJ IDEA.
  User: 34289
  Date: 2024/10/29
  Time: 上午8:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="jspSamples..unit7.websiteSample.*" %>
<%
    request.setCharacterEncoding("GBK");
    News News1 = new News();
    String NewsID = request.getParameter("newsID");
    String Action = request.getParameter("action");
    if (Action!=null && Action.equals("Edit")) {
        String[] s = new String[2];
        s[0] = request.getParameter("upd_NewsTitle");
        s[1] = request.getParameter("upd_NewsContent");
        String sOK = News1.EditNews(s,NewsID);
        if (sOK.equals("Yes")){
            out.println("<script>alert('修改新闻成功!');location.href= 'news.jsp';</script>");
            return;
        }else {
            out.println("<script>alert('修改新闻失败!');location.href= 'news.jsp';</script>");
            return;
        }
    }
%>
<html>
<head>
    <title>Title</title>
</head>
<body>

</body>
</html>
